#pragma once

#include "planner/operator_visitor.h"

namespace optimizer {

class Group;
class GroupExpression;
class OptimizerContext;

class StatsCalculator : public OperatorVisitor {
 public:
  StatsCalculator() = default;
  void CalculateStats(GroupExpression *gexpr, OptimizerContext *context);

  void Visit(LogicalGet *logical_get) override;

 private:
  void DriveGroupTarget();

  GroupExpression *gexpr_;
  OptimizerContext *context_;
  Group *group_;
};

}  // namespace optimizer